<?php

if (! defined ( 'BASEPATH' ))
	exit ( 'No direct script access allowed' );
class Controller_Default extends CI_Controller {
	private $m_current_period = null;
	private $m_last_period = null;
	
	public function __construct() {
		parent::__construct ();
		
		$this->load->model ( 'Model_User', 'User' );
		$this->load->model ( 'Model_Cover_Gril', 'Cover_Gril' );
	}
	
	public function index() {
		$type = $_POST ['type'];
		switch ($type) {
			case 1 :
				log_message ( 'debug', "login" );
				$this->login ();
				break;
			case 2 :
				$this->modify ();
				break;
			case 3 :
				$this->send_device_info ();
				break;
			case 4 :
				$this->reset_password ();
				break;
			case 100 :
				$this->upload_cover_gril ();
				break;
			case 101 :
				log_message('debug', "get_competition_by_userid 0");
				 $this->get_user_competition_info ();
				break;
			case 102 :
				$this->get_current_period_cover_gril_list ();
				break;
			case 103 :
				$this->get_last_period_cover_gril_list ();
				break;
			case 104 :
				$this->cover_gril_vote ();
				break;
			case 105 :
				break;
			case 1000 :
				$this->send_register_email ( "tangchaoyong123@gmail.com", "budweiser", "2222000" );
				break;
			default :
				break;
		}
	}
}
